from dataclasses import dataclass

"""
策略风险评估结果
"""


@dataclass
class RiskAssessment:

    # 股票代码
    stock_code: str

    # 风险描述
    description: str

    # 策略基础信息
    StrategyInfoMetadata: int

    # 最终得分
    end_point: int

    def __init__(self, stock_code, description, risk_type, risk_level, future_action):
        self.stock_code = stock_code  # 股票代码
        self.description = description  # 风险描述
        self.risk_type = risk_type  # 风险类型 (例如：市场风险、流动性风险)
        self.risk_level = risk_level  # 风险等级 (1-10级)
        self.future_action = future_action  # 未来操作建议 (例如：买入、卖出、持有)

    def assess_risk(self):
        # 风险评估逻辑，这里可以根据风险等级做出相应的操作或返回评估信息
        return {
            "stock_code": self.stock_code,
            "risk_type": self.risk_type,
            "risk_level": self.risk_level,
            "future_action": self.future_action,
        }
